from hashlib import md5
import hashlib

def make_password(mypass):
    #生成md5对象
    md5 = hashlib.md5()

    #定义加密对象
    sign_str = mypass
    #转码
    sign_utf8 = str(sign_str).encode('utf-8')
    #加密
    md5.update(sign_utf8)
    #生成密文
    md5_server = md5.hexdigest()
    return md5_server




def check_passwrod(mypass):
    #生成md5对象
    hash = hashlib.md5()
    #定义对象
    s_str = mypass
    #转码
    s_utf8 = str(s_str).encode(encoding='utf-8')
    #加密
    hash.update(s_utf8)
    #生成密文
    md5_server = hash.hexdigest()
    return md5_server

